<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include/head::commonHeader('oc课课后回访')">
<body>
<div id="content" class="col-md-12 col-sm-12" style="padding:0;">
    <div class="row">
        <div class="box col-md-12" style="margin-top:3px;">
            <div class="box-inner">
                <div class="box-header well" data-original-title="">
                    <h2>
                        <i class="glyphicon glyphicon-user"></i> oc课课后回访
                    </h2>
                    <div class="box-icon">
                        <!-- <a href="#" class="btn btn-setting btn-round btn-default"><i class="glyphicon glyphicon-cog"></i></a> -->
                        <a href="javascript:void(0);" id="smaller" class="btn btn-minimize btn-round btn-default"><i class="glyphicon glyphicon-chevron-up"></i></a>
                        <!-- <a href="#"	class="btn btn-close btn-round btn-default"><i class="glyphicon glyphicon-remove"></i></a> -->
                    </div>
                </div>
                <div class="box-content">
                    <form class="form-inline" style="margin-bottom:0.5%" id="searchForm" role="form" method="post"
                          th:action="${#request.getRequestURI()}">
                            <div class="form-group ">
                                <input type="hidden" id="paperType" name="paperType" th:value="${paperType}"/>
                                <select name="pageSize" class="form-control input-sm" onchange="$('form').submit();">
                                    <option value="10" th:selected="${pageInfo.pageSize==10}">10条/页</option>
                                    <option value="25" th:selected="${pageInfo.pageSize==25}">25条/页</option>
                                    <option value="50" th:selected="${pageInfo.pageSize==50}">50条/页</option>
                                </select>
                                <!--<div class="col-md-0">-->
                                    <!--<div class="input-group input-group-sm">-->
                                        <!--<input type="hidden" th:value="${pageInfo.pageNum}" name="pageNum" id="pageNum">-->
                                    <!--</div>-->
                                <!--</div>-->
                                <select name="teacher" id="teacher" class="form-control input-sm">
                                    <option value="">--选择OC课老师--</option>
                                    <!--/*@thymesVar id="teacher" type="java"*/-->
                                    <option th:selected="${teacher == list.loginName}" th:each="list:${sscList}"
                                            th:value="${list.loginName}" th:text="${list.loginName}"></option>
                                </select>

                                <!--/*@thymesVar id="strStartDate" type="java"*/-->
                                <input th:value="${strStartDate}" type="search" class="form-control input-sm" style="width:100px;"
                                       id="strStartDate" name="strStartDate" onFocus="WdatePicker({readOnly:true})" placeholder="课程起始日期" autocomplete="off" title="课程起始日期"/>
                                -
                                <!--/*@thymesVar id="strEndDate" type="java"*/-->
                                <input th:value="${strEndDate}" type="search" class="form-control input-sm" style="width:100px;"
                                       id="strEndDate" name="strEndDate" onFocus="WdatePicker({readOnly:true})" placeholder="课程终止日期" autocomplete="off" title="课程终止日期"/>

                                <input th:value="${addStrStartDate}" type="search" class="form-control input-sm" style="width:100px;"
                                       id="addStrStartDate" name="addStrStartDate" onFocus="WdatePicker({readOnly:true})" placeholder="提交起始日期" autocomplete="off" title="提交起始日期"/>
                                 -
                                <input th:value="${addStrEndDate}" type="search" class="form-control input-sm" style="width:100px;"
                                       id="addStrEndDate" name="addStrEndDate" onFocus="WdatePicker({readOnly:true})" placeholder="提交终止日期" autocomplete="off" title="提交终止日期"/>

                                <input type="text" class="form-control input-sm" id="search" name="search" th:value="${search}" placeholder="请输入关键字"/>

                                <button class="btn btn-primary" type="submit"> 查 询 </button>
                                <a id ="export"  class="btn btn-warning "><span class="glyphicon glyphicon-export"></span> 导出结果 </a>
                        </div>

                    </form>
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th style="text-align: center;">上课学员</th>
                            <th style="text-align: center;">课程顾问</th>
                            <th style="text-align: center;">学习顾问</th>
                            <th style="text-align: center;">上课老师</th>
                            <th style="text-align: center;">上课时间</th>
                            <th style="text-align: center;">提交人</th>
                            <th style="text-align: center;">提交时间</th>
                            <th style="text-align: center;">平均分</th>
                            <th style="width: 200px;text-align: center;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="questionnaireOcList : ${pageInfo.list}" th:attr="qocId = ${questionnaireOcList.id}">
                            <td th:text="${questionnaireOcList.studentLogin}">studentLogin</td>
                            <td style="text-align: center;" th:text="${questionnaireOcList.ccName}">ccName</td>
                            <td style="text-align: center;" th:text="${questionnaireOcList.sscName}">sscName</td>
                            <td style="text-align: center;" th:text="${questionnaireOcList.teacher}">teacher</td>
                            <td style="text-align: center;" th:text="${#dates.format(questionnaireOcList.releaseTime, 'yyyy-MM-dd HH:mm:ss')}">releaseTime</td>
                            <td style="text-align: center;" th:text="${questionnaireOcList.addUserName}">addUserName</td>
                            <td style="text-align: center;" th:text="${#dates.format(questionnaireOcList.createTime, 'yyyy-MM-dd HH:mm:ss')}">createTime</td>
                            <td style="text-align: center;" th:text="${questionnaireOcList.grade}">grade</td>
                            <td style="text-align: center;"><!--th:href="@{/questionnaireOc/checkPapers(questionnaireId = ${questionnaireOcList.id})}"-->
                                <a  href="javascript:void(0)"   th:attr="questionnaireId=${questionnaireOcList.id}" class="btn btn-success detail" role="button"><span class="glyphicon glyphicon-pencil-sign"></span> 查看问卷</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div th:include="include/pageinfo::pager"></div>
                </div>
            </div>
        </div>
        <!--/span-->
    </div>
    <!--/row-->
    <!-- content ends -->
</div>
<!--/#content.col-md-0-->
<div th:include="include/onload_js::onloadJSCustomList(~{::script})">
    <script>
        $(function () {
            $(".detail").click(function(){
                var url = "/questionnaireOc/checkPapers?questionnaireId="+$(this).attr("questionnaireId");
                layer.open({
                type: 2,
                title: false,
                closeBtn: 1, //显示关闭按钮
                shade: [0],
                area: ['60%', '95%'],
                //offset: 'rb', //右下角弹出
                // time: 2000, //2秒后自动关闭
                anim: 2,
                content: [url, 'yes'], //iframe的url，no代表不显示滚动条
                end: function () { //此处用于演示
                }
            });
        });

            $("#export").click(function(){
                var paperType= $("#paperType").val();
                var teacher = $("#teacher").val();
                var strStartDate = $("#strStartDate").val();
                var strEndDate =  $("#strEndDate").val();
                var addStrStartDate = $("#addStrStartDate").val();
                var addStrEndDate =  $("#addStrEndDate").val();
                var search =  $("#search").val();
                window.location.href = "/questionnaireOc/exportExcel?paperType=" + paperType +
                    "&strStartDate=" + strStartDate +
                    "&strEndDate=" + strEndDate +
                    "&addStrStartDate=" + addStrStartDate +
                    "&addStrEndDate=" + addStrEndDate +
                    "&teacher=" + teacher +
                    "&search=" + search
                ;
         });

            $("#smaller").click(function () {
                var box = $(this).parent().parent().next(".box-content");
                //$(box).toggle('fast');
                if($(box).css('display')=='none'){
                    $("#smaller").html("<i class=\"glyphicon glyphicon-chevron-up\"></i>");
                    $(box).show('fast');
                }else{
                    $("#smaller").html("<i class=\"glyphicon glyphicon-chevron-down\"></i>");
                    $(box).hide('fast');
                }
            });
        });

    </script>
</div>
</body>
</html>
